<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcss.com/vue/2.6.11/vue.min.js"></script>
    <script src="https://cdn.bootcss.com/vue-resource/1.5.1/vue-resource.min.js"></script>
</head>
<body>
<h1 id="h1">Hello <span v-html="username"></span></h1>
    <a href="http://localhost:8082/" target="_blank">另一个客户端</a>


<script>
    var vm = new Vue({
        el:"#h1",
        data:{
            username:""
        },
        methods:{

        },
        created:function () {
            this.$http.get("/user-details").then(function (result) {
                if(result.ok){
                    this.username = result.body.username;
                }
            },function (reason) {
                this.username = "<a href='/sign-on'>请登录</a>";
            });
        }
    });
</script>
</body>
</html>